<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="mainMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="1" />
<title>内部用户部门</title>
<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script>
	$(document).ready(function() {
		var deptSet =  $("#depSet").val();
		if(null==deptSet){
			confirm("此操作当前不能进行!");
			$("#submitBtn").attr("disabled","disabled");
		}
		
		$("input[name='startDate']").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '1900-10-01',
				maxDate : '#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		$("input[name='endDate']").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '#F{$dp.$D(\'startDate\')}',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		$("#username").focus();
		$("#inputForm").validate({
			rules:{
				startDate:"required"
			},
			messages:{
				startDate:{
					required:"必须选择开始时间！",
				}
			}
		});
	});


</script>
</head>
<body>
<form action="insideuserdept!save.action" method="post" class="yform"
	id="inputForm">
<h1>添加用户部门信息</h1>
<table class="noborder">
	<tr class="type-text">
		<td>职务</td>
		<td><input type="text" value="${officalPosition }" name="officalPosition" />
			<input type="hidden" value="${id}" name="id" />
			<input type="hidden" value="${userId}" name="userId" />
			<input type="hidden" value="${organizationId}" name="organizationId" />
			<c:if test="${fn:length(id)==0}">
			<input type="hidden" value="${userId}" name="user.id"/>
			</c:if>
			<c:if test="${fn:length(id)!=0}">
			<input type="hidden" value="${user.id}" name="user.id"/>
			</c:if>
			</td>
	</tr>

	<tr class="type-text">
	    <td>部门名称</td>
		<td>
			<s:select id="depSet" list="departmentList" emptyOption="请选择"  listKey="id"  listValue="depName" name="dept.id"></s:select>
		</td>
		
	</tr>
	<tr class="type-text">
		<td>开始时间</td>
		<td><input type="text" readonly="readonly" id="startDate"
			name="startDate" value="${startDate }" /></td>
	</tr>
	<tr class="type-text">
		<td>结束时间</td>
		<td><input type="text" readonly="readonly" id="endDate"
			name="endDate" value="${endDate }" /></td>
	</tr>
	<tr class="type-text">
		<td>备注</td>
		<td><textarea rows="5" cols="60" name="remark">${remark }</textarea>
		</td>
	</tr>
</table>
		<div class="type-button"><input id="submitBtn"   type="submit"
			class="submit" value="提交"  />&nbsp; <input  
			type="button" value="返回" class="reset" onclick="history.back()" /></div>
</form>
</body>
</html>